package com.enjoyor.soa.traffic.server.efoms.dubbo.invoke;

import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSONObject;
import com.enjoyor.soa.traffic.api.serverpush.server.dubbo.DubboServerPushService;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

@Component
public class DubboServerPushInvoke {

	@Reference(timeout = 10000)
    private DubboServerPushService dubboServerPushService;

    /**
     * 推送消息
     * @param namespace 消息队列名
     * @param message 消息内容
     * @return
     */
    public ResultPojo pushMessage(String namespace, JSONObject message) {
        ResultPojo pojo = dubboServerPushService.pushMessage(namespace, message);
        return pojo;
    }
}
